package com.zp.oj.judge.CodeSandBox;

import com.zp.oj.judge.CodeSandBox.impl.ExampleCodeSandBox;
import com.zp.oj.judge.CodeSandBox.impl.RemoteCodeSandBox;
import com.zp.oj.judge.CodeSandBox.impl.ThirdPartCodeSandBox;
import org.springframework.beans.factory.annotation.Value;

public class CodeSandBoxFactory {
    /**
     * 类型为定义的实例
     * @param type
     * @return
     */
    public static CodeSandBox newInstance(String type){
        switch (type){
            case "example":
                return new ExampleCodeSandBox();
            case "remote":
                return new RemoteCodeSandBox();
            case "thirdPart":
                return new ThirdPartCodeSandBox();
            default:
                return new ExampleCodeSandBox();
        }
    }
}
